<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>TileShadowNode - Three.js Docs</title>
	<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	<script src="../scripts/highlight.min.js"></script>
	<link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
	<link type="text/css" rel="stylesheet" href="../styles/page.css">
</head>
<body>
		<p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Node.html">Node</a> → <a href="ShadowBaseNode.html">ShadowBaseNode</a> → </p>
	<h1 translate="no">TileShadowNode</h1>
		<section>
			<header>
				<div class="class-description"><p>A class that extends <code>ShadowBaseNode</code> to implement tiled shadow mapping.
This allows splitting a shadow map into multiple tiles, each with its own light and camera,
to improve shadow quality and performance for large scenes.</p>
<p><strong>Note:</strong> This class does not support <code>VSMShadowMap</code> at the moment.</p></div>
			</header>
			<article>
				<h2 class="subsection-title">Import</h2>
				<p><span translate="no">TileShadowNode</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
				<pre><code class="language-js">import { TileShadowNode } from 'three/addons/tsl/shadows/TileShadowNode.js';</code></pre>
				<div class="container-overview">
					<h2>Constructor</h2>
					<h3 class="name name-method" id="TileShadowNode" translate="no">new <a href="#TileShadowNode">TileShadowNode</a><span class="signature">( light : <span class="param-type"><a href="Light.html">Light</a></span>, options : <span class="param-type">Object</span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>Creates an instance of <code>TileShadowNode</code>.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>light</strong>
									</td>
									<td class="description last">
										<p>The original light source used for shadow mapping.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>options</strong>
									</td>
									<td class="description last">
										<p>Configuration options for the tiled shadow node.</p>
										<p>Default is <code>{}</code>.</p>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>tilesX</strong>
									</td>
									<td class="description last">
										<p>The number of tiles along the X-axis.</p>
										<p>Default is <code>2</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>tilesY</strong>
									</td>
									<td class="description last">
										<p>The number of tiles along the Y-axis.</p>
										<p>Default is <code>2</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>resolution</strong>
									</td>
									<td class="description last">
										<p>The resolution of the shadow map.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>debug</strong>
									</td>
									<td class="description last">
										<p>Whether to enable debug mode.</p>
										<p>Default is <code>false</code>.</p>
									</td>
								</tr>
							</tbody>
						</table>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<h2 class="subsection-title">Methods</h2>
					<h3 class="name name-method" id="disposeLightsAndNodes" translate="no">.<a href="#disposeLightsAndNodes">disposeLightsAndNodes</a><span class="signature">()</span> </h3>
					<div class="method">
						<div class="description">
							<p>Helper method to remove lights and associated nodes/targets.
Used internally during dispose and potential re-initialization.</p>
						</div>
					</div>
					<h3 class="name name-method" id="generateTiles" translate="no">.<a href="#generateTiles">generateTiles</a><span class="signature">( tilesX : <span class="param-type">number</span>, tilesY : <span class="param-type">number</span> )</span><span class="type-signature"> : Array.&lt;Object></span> </h3>
					<div class="method">
						<div class="description">
							<p>Generates the tiles for the shadow map based on the specified number of tiles along the X and Y axes.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>tilesX</strong>
									</td>
									<td class="description last">
										<p>The number of tiles along the X-axis.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>tilesY</strong>
									</td>
									<td class="description last">
										<p>The number of tiles along the Y-axis.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> An array of tile objects, each containing the tile's bounds and index.</dt>
						</dl>
					</div>
					<h3 class="name name-method" id="init" translate="no">.<a href="#init">init</a><span class="signature">( builder : <span class="param-type">Builder</span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>Initializes the tiled shadow node by creating lights, cameras, and shadow maps for each tile.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>builder</strong>
									</td>
									<td class="description last">
										<p>The builder used to create render targets and other resources.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<h3 class="name name-method" id="setup" translate="no">.<a href="#setup">setup</a><span class="signature">( builder : <span class="param-type">Builder</span> )</span><span class="type-signature"> : <a href="Node.html">Node</a></span> </h3>
					<div class="method">
						<div class="description">
							<p>Sets up the shadow node for rendering.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>builder</strong>
									</td>
									<td class="description last">
										<p>The builder used to set up the shadow node.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-overrides"><strong>Overrides:</strong> <a href="ShadowBaseNode.html#setup">ShadowBaseNode#setup</a></dt>
						</dl>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> A node representing the shadow value.</dt>
						</dl>
					</div>
					<h3 class="name name-method" id="syncLightTransformation" translate="no">.<a href="#syncLightTransformation">syncLightTransformation</a><span class="signature">( lwLight : <span class="param-type">LwLight</span>, sourceLight : <span class="param-type"><a href="Light.html">Light</a></span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>Synchronizes the transformation of a tile light with the source light.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>lwLight</strong>
									</td>
									<td class="description last">
										<p>The tile light to synchronize.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>sourceLight</strong>
									</td>
									<td class="description last">
										<p>The source light to copy transformations from.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">()</span> </h3>
					<div class="method">
						<div class="description">
							<p>Updates the light transformations and shadow cameras for each tile.</p>
						</div>
						<dl class="details">
							<dt class="tag-overrides"><strong>Overrides:</strong> <a href="ShadowBaseNode.html#update">ShadowBaseNode#update</a></dt>
						</dl>
					</div>
					<h3 class="name name-method" id="updateBefore" translate="no">.<a href="#updateBefore">updateBefore</a><span class="signature">( frame : <span class="param-type"><a href="NodeFrame.html">NodeFrame</a></span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>The implementation performs the update of the shadow map if necessary.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>frame</strong>
									</td>
									<td class="description last">
										<p>A reference to the current node frame.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-overrides"><strong>Overrides:</strong> <a href="ShadowBaseNode.html#updateBefore">ShadowBaseNode#updateBefore</a></dt>
						</dl>
					</div>
					<h3 class="name name-method" id="updateLightDirection" translate="no">.<a href="#updateLightDirection">updateLightDirection</a><span class="signature">()</span> </h3>
					<div class="method">
						<div class="description">
							<p>Updates the initial light direction based on the light's target position.</p>
						</div>
					</div>
					<h3 class="name name-method" id="updateShadow" translate="no">.<a href="#updateShadow">updateShadow</a><span class="signature">( frame : <span class="param-type"><a href="NodeFrame.html">NodeFrame</a></span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>Updates the shadow map rendering.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>frame</strong>
									</td>
									<td class="description last">
										<p>A reference to the current node frame.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				<h2 class="subsection-title">Source</h2>
				<p>
					<a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/shadows/TileShadowNode.js" translate="no" target="_blank" rel="noopener">examples/jsm/tsl/shadows/TileShadowNode.js</a>
				</p>
			</article>
		</section>
<script src="../scripts/linenumber.js"></script>
<script src="../scripts/page.js"></script>
</body>
</html>